﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;
using System.Web.UI;
using ARS.Control.Interface;
using ARS.PublicTool.WebHelper.WebPage;

namespace ARS.Control.Factory
{


    public  class DialogFactory
    {
        //public static Interface.IDialog DefaultDialog()
        //{

        //}

        public static Interface.IDialog CreateDialog()
        {
            string AssemblyPath = ConfigurationManager.AppSettings["DialogAssembly"];
            string ClassNamespace=null;
            if (string.IsNullOrEmpty(AssemblyPath))
            {
                return new DefaultDialog();
                //throw new Exception("没有配置dialog");
            }
            else
            {
                ClassNamespace = ConfigurationManager.AppSettings["DialogClass"];
            }

            object objType = ARS.PublicTool.ReflectionHelper.CreateObjectNoCache(AssemblyPath, ClassNamespace);
            //if (objType == null)
            //{
            //    //throw new Exception("aaa");
            //}
            return (Interface.IDialog)objType;
        }
    }
}
